package com.ruoyi.web.controller.user;

import com.ruoyi.common.core.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/shop")
@Api(tags = "店铺信息")
@Slf4j
public class UserShopController {

    @Autowired
    private RedisTemplate redisTemplate;
    @GetMapping("/status")
    @ApiOperation("获取店铺状态")
    public AjaxResult getStatus(){
        Integer status = (Integer)redisTemplate.opsForValue().get("shopStatus");
        log.info("获取店铺状态:{}",status==1? "营业中":"打样中");
        return AjaxResult.success(status);
    }



}
